import static org.junit.Assert.*;

import org.junit.Test;


public class ICalCreatorTest {
	private ICalCreator cal = new ICalCreator();
	private ICalCreator.iCalDate tst = cal.new iCalDate("2013", "08", "08", "10", "00");
	private ICalCreator.iCalDate start = cal.new iCalDate("2013", "08", "08", "10", "00");
	private ICalCreator.iCalDate end = cal.new iCalDate("2013", "08", "08", "12", "00");
	private ICalCreator.Event reg = cal.new Event("Study", "Library", "Something", "Paper", start, end);
	private ICalCreator.iCalDate rstart = cal.new iCalDate("2013", "08", "08", "10", "00");
	private ICalCreator.iCalDate rend = cal.new iCalDate("2013", "08", "08", "12", "00");
	private ICalCreator.iCalDate recend = cal.new iCalDate("2014", "08", "08", "10", "00");
	private ICalCreator.Event rec = cal.new Event("Study", "Library", "Something", "Paper", rstart, rend, recend, "MONTHLY");
	
	@Test
	public void getMonthtester() {
		String mn = "08";
		assertEquals("Should be 08", mn, tst.getMonth());
	}
	
	public void getYearTester(){
		String yr = "2013";
		assertEquals("Should be 2013", yr, tst.getYear());
	}
	public void getDaytester() {
		String day = "08";
		assertEquals("Should be 08", day, tst.getDay());
	}
	
	public void getHourTester(){
		String hr = "10";
		assertEquals("Should be 10", hr, tst.getHour());
	}
	public void getMinTester(){
		String min = "00";
		assertEquals("Should be 00", min,  tst.getMin());
	}
	public void evtICSTester(){
		String ics = "CLASS:" + "PUBLIC" + "\n" +
                "SUMMARY:Study" + "\n" +
                "COMMENT:Something" + "\n" +
                "LOCATION:Library" + "\n" +
                "RESOURCES:Paper" + "\n" +
                "DTSTART:20130808T100000Z" + "\n" +
                "DTEND:20130808T120000Z" + "\n" +
                "TZID:HAWAII" + "\n";
		assertEquals("Should be like ics", ics, reg.evtIcs());
	}
	public void revtICSTester(){
		String recics = "CLASS:" + "PUBLIC" + "\n" +
                "SUMMARY:Study" + "\n" +
                "COMMENT:Something" + "\n" +
                "LOCATION:Library" + "\n" +
                "RESOURCES:Paper" + "\n" +
                "DTSTART:20130808T100000Z" + "\n" +
                "DTEND:20130808T120000Z" + "\n" +
                "TZID:HAWAII" + "\n" + 
				"RRULE:FREQ=MONTHLY;UNTIL:20130808T100000Z" + "\n";
		assertEquals("Should be like ics", recics, rec.evtIcs());
		
	}

}
